#!/usr/bin/env bash

# Stop plugin service
#sudo launchctl remove tw.com.lumens.CameraControllerPlugin.Helper

# Preferences
# rm -f ~/Library/Preferences/tw.com.Lumens.LumensCameraController

# Application
rm -rf /Applications/Camera\ Controller.app

# Ini
rm -rf /Library/Application\ Support/LumensCameraController

# Plugin
#rm -rf /Library/CoreMediaIO/Plug-Ins/DAL/LumensCameraController.Plugin
#rm -rf /Library/LaunchDaemons/tw.com.lumens.CameraControllerPlugin.Helper.plist
#rm -rf /Library/PrivilegedHelperTools/tw.com.lumens.CameraControllerPlugin.Helper

# Receipts
ls /var/db/receipts/tw.com.lumens.pkgs.LumensCameraController* | xargs rm -rf


# For macOS 10.15 above
# Clear permissions if available
sudo tccutil reset All tw.com.lumens.LumensCameraController || true

#Remove settings
rm -rf ~/Library/Preferences/tw.com.lumens.LumensCameraController.plist
rm -rf ~/Library/Application\ Support/LumensCameraController
